from django.db import models

class Game(models.Model):
    name = models.CharField(max_length=50,unique=True)
    def __unicode__(self):
        return self.name
    
class Role(models.Model):
    game = models.ForeignKey(Game)
    name = models.CharField(max_length=50)
    def __unicode__(self):
        return self.name

class Class(models.Model):
    game = models.ForeignKey(Game)
    name = models.CharField(max_length=50)
    css_name = models.CharField(max_length=25)
    roles = models.ManyToManyField(Role)
    def __unicode__(self):
        return self.name

class Serveur(models.Model):
    game = models.ForeignKey(Game)
    name = models.CharField(max_length=50)
    def __unicode__(self):
        return self.name

#class Roles_Classes(models.Model):
#    classes = models.ForeignKey(Class)
#    roles = models.ForeignKey(Role)
#
#    def __unicode__(self):
#        return self.classes.name + ' ' + self.roles.name
